package com.htz.agency.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.htz.agency.pojo.Announcement;
import com.htz.agency.pojo.AnnouncementExpired;
import com.htz.agency.pojo.dto.AnnouncementDTO;
import com.htz.agency.pojo.query.AnnouncementQuery;
import com.htz.agency.pojo.vo.AnnouncementVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Date;
import java.util.List;

@Mapper
public interface AnnouncementMapper  extends BaseMapper<Announcement> {

    IPage<AnnouncementVO> list(IPage<AnnouncementVO> page, @RequestBody AnnouncementQuery query);


    @Select("select * from announcements where id = #{id}")
    AnnouncementVO getById(Long id);


    void deleteById(Integer id);

    void exDeletedByIds(List<Integer> list);

    List<Integer> getByDeleted();

    Boolean deleteAll(List<Integer> byDeletedIds);

    List<Announcement> getByExpired(Date date);


    Boolean saveExpiredAnnouncement(List<AnnouncementExpired> announcementsExpired);
}
